<template>
<!--  疫情热点-->
  <div class="hot">
    <div class="top">
      <div class="text">疫情热点</div>
    </div>
    <div class="bottom">
      <router-link tag="div" :to="`/details/${setUrl(setUrl(item.summary))}`" class="info" v-for="item in hotArr" :key="item.id">
        <div class="left">
          <span class="new">最新</span>
          <span class="details">{{ item.title }}</span>
        </div>
        <div class="right">&gt;</div>
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  data(){
   return{
   }
  },
  props:{
    hotArr:{
      type:Array,
      default:function (){
        return []
      }
    }
  },
methods:{
  setUrl (text) {
    if (text) {
      return encodeURIComponent(text)
    }
  }
}
}
</script>

<style lang="less" scoped>
.hot{
  background-color: #fff;
  width: 100%;
  .top{
    padding:15px 10px 10px;
    .text{
      padding-left: 10px;
      border-left: 4px solid orange;
    }
  }
  .bottom{
    padding: 0px 10px 10px;
    .info{
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      margin-top: 10px;
      .left{
        .new{
          color: #ffffff;
          background-color: red;
          padding: 3px;
          border-radius: 4px;
        }
        .details{
          margin-left: 10px;
        }
      }
      .right{

      }
    }
  }
}
</style>

